import request from '@/utils/request'


function bookList (param) {
  return request({
    url: '/book/list',
    method: 'get',
    params: param
  });
}

function addBook (data) {
  return request({
    url: '/book/add',
    method: 'post',
    data
  });
}

function editBook (data) {
  return request({
    url: '/book/update',
    method: 'post',
    data
  });
}

function delBook (id) {
  return request({
    url: '/book/delete',
    method: 'get',
    params: {
      id: id
    }
  });
}

function getById (id) {
  return request({
    url: '/book/detail',
    method: 'get',
    params: {
      id: id
    }
  });
}

export {
  bookList,
  addBook,
  editBook,
  delBook,
  getById
}
